<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>mtlb_setstr</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>M2SCI function</center>
    <div align="right">Last update : 09/04/2004</div>
    <p>
      <b>mtlb_setstr</b> - Matlab setstr emulation function</p>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>Matlab <tt>
        <b>setstr</b>
      </tt> and Scilab <tt>
        <b>ascii</b>
      </tt> behave differently in some particular cases:</p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        With character string input: Matlab <tt>
              <b>setstr</b>
            </tt> returns a character string
	while Scilab <tt>
              <b>ascii</b>
            </tt> returns ASCII codes.
        </li>
        </dd>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        With double matrix input: Matlab <tt>
              <b>setstr</b>
            </tt> returns a character matrix
	having the same size as input while Scilab <tt>
              <b>ascii</b>
            </tt> returns a single character string
        </li>
        </dd>
      </dd>
    </dl>
    <p>
    The function <tt>
        <b>mtlb_setstr(A)</b>
      </tt> is used by
    <tt>
        <b>mfile2sci</b>
      </tt> to replace <tt>
        <b>setstr(A)</b>
      </tt> when it was not
    possible to know what was the input while porting Matlab code to Scilab. This function will
    determine the correct semantic at run time. If you want to have a
    more efficient code it is possible to replace <tt>
        <b>mtlb_setstr</b>
      </tt> calls:
    </p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>A</b>
            </tt> is a character string or a character string matrix
        <tt>
              <b>mtlb_setstr(A)</b>
            </tt> may be replaced by <tt>
              <b>A</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>A</b>
            </tt> is a double row vector
        <tt>
              <b>mtlb_setstr(A)</b>
            </tt> may be replaced by <tt>
              <b>ascii(A)</b>
            </tt>
          </li>
        </dd>
      </dd>
    </dl>
    <p>Caution: <tt>
        <b>mtlb_setstr</b>
      </tt> has not to be used for hand coded functions.</p>
    <h3>
      <font color="blue">Authors</font>
    </h3>
    <dl>
      <dd>
        <b></b>V.C.</dd>
    </dl>
  </body>
</html>
